package com.yxj01;

public class RecursionDemo02 {
    public static void main(String[] args) {
        //递归求阶乘
        System.out.println(fun(5));
    }
    public static int fun(int n) {
        if(n == 1) {
            return 1;
        }else {
            return n*fun(n-1);
        }
    }
}
